<template>
  <van-collapse v-on="$listeners" v-bind="$attrs">
    <template v-if="dataSource.length > 0">
      <van-collapse-item
        :name="index + 1"
        v-for="(item, index) in dataSource"
        :key="index"
      >
        <slot />
      </van-collapse-item>
    </template>
    <template v-for="(index, name) in $slots" v-slot:[name]>
        <slot :name="name"/>
    </template>
  </van-collapse>
</template>
<script>
export default {
  name: "eagle-collapse",
  props: {
    dataSource: {
      type: Array,
      default() {
        return [];
      },
    },
  },
  methods: {},
};
</script>